﻿@model MvcCmsProjectTracker.ViewModels.BugEditViewModel
@{
    var originatingTicket = Model.Bug.OriginatingTickets.FirstOrDefault();
}           
@section HtmlHead{

}
<h2>Set Project For Developer<br />
    Issue:@Model.Bug.BugID
</h2>
<div style="position: relative;">
    <form id="form1" action="" method="post">
    <div id="actionbuttons" style="width: 800px; text-align: right;">
        <p>
            <button onclick="SubmitForm();">
                Save</button>
            @Html.ActionLink("Delete", "Delete", new { id = Model.Bug.BugID }, new { @class = "button" })
            <a href="/projecttracker/Bug/IncomingIssues" class="button">Back To List</a>  
        </p>
    </div>
    <hr />
    <div class="editor-label" style="float: left; width: 150px">
        @Html.LabelFor(model => model.Bug.Title):
    </div>
    <div class="editor-field" style="float: left;">
        @Html.TextBox("Title", Model.Bug.Title, new { style = "width:650px" })
    </div>
    <div class="clear">
    </div>

    <div class="editor-label" style="float: left; width: 150px">
        @Html.LabelFor(model => model.Bug.LastUpdate):
    </div>
    <div class="editor-field" style="float: left;">
        @String.Format("{0:g}", Model.Bug.LastUpdate)
    </div>
    <div class="clear">
    </div>
    <hr />
    <div style="float: left; width: 430px">
        <div class="editor-label" style="float: left; width: 150px">
            @Html.LabelFor(model => model.Bug.CreatorUserName):
        </div>
        <div class="editor-field" style="float: left;">
            @Model.Bug.CreatorUserName
        </div>
        <div class="clear">
        </div>
        <div class="editor-label" style="float: left; width: 150px">
            @Html.LabelFor(model => model.Bug.DateCreated):
        </div>
        <div class="editor-field" style="float: left;">
            @String.Format("{0:g}", Model.Bug.DateCreated)
        </div>
        <div class="clear">
        </div>
        <div class="editor-label" style="float: left; width: 150px">
            Project:
        </div>
        <div class="editor-field" style="float: left;">
            @Model.ProjectName
        </div>
        <div class="clear">
        </div>
    </div>
    <div style="float: left">
        <div class="editor-label" style="float: left; width: 150px">
            @Html.Label("Project For Developer"):
        </div>
        <div class="editor-field" style="float: left;">
            @Html.DropDownList("ProjectID", new SelectList(Model.UsersProjects, "ProjectID", "Name"), new { style = "width:200px" })
        </div>
        <div class="clear">
        </div>
        <div class="editor-label" style="float: left; width: 150px">
            Originating ticket:
        </div>
        <div class="editor-field" style="float: left;">
            #<a href="/projecttracker/Ticket/Edit/@originatingTicket.TicketID">@originatingTicket.TicketID</a>: @originatingTicket.Title
        </div> 
        <div class="clear">
        </div>
    </div>
    <div class="clear">
    </div>       
    @Html.Hidden("BugID", Model.Bug.BugID) 
    </form>
</div>
<br />
@section ScriptContent{
}
